fix(voice): keep Realtime handoff audio and prevent hangup errors - #318
Conversation
Track coordinator cancellation requests and consume correlated no-active-response errors before forwarding provider events to the host. Preserve fatal handling for unrelated and unexpected errors. Validation: Blox jtennant-berd-cancel-race-20260910 at base 5d5708e; 256 voice library tests and 24 protocol tests passed, plus just fmt-check, check, tauri-check, and clippy. Local changed file is byte-identical to the validated tree (SHA-256 2cf53b9b7e542ccc73e935627d69e26fb18d0c1e2fb0b15afcf48a7e45e0c0a5). Supplemental all-targets Clippy diagnostics also reproduce on unchanged main. Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
* origin/main: refactor(voice): rename berd-voice to berd-call (#338) docs: warn about bb-cli migration (#337) feat(voice): play status cues while working or waiting (#308) chore: bump goose backend pin to 2c02ed6f (#331) fix(windows): never resolve Git Bash to the WSL or Store bash.exe stubs (#328) fix(windows): keep the Windows script tests runnable on Windows PowerShell 5.1 (#329) chore: bump goose backend pin to 616cdce9 (#330) feat(chat): add starred models to the agent model picker (#287) chore: bump goose backend to 51d9effe (#325) fix(chat): collapse labeled monitor updates (#324) default project chats to a saved SSH environment (#323) Signed-off-by: John Tennant <jtennant@block.xyz>
|
🤖 User-observed Realtime lifecycle bug from live testing: ending an Expert-Spokesperson call displayed |
* origin/main: fix(voice): keep status cues subordinate to speech (#339) Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
morgmart
left a comment
There was a problem hiding this comment.
🤖 Automated code review
Engineering review found no publishable findings in the exact PR comparison. The changed voice-call lifecycle, cancellation correlation, transcript discard handling, shutdown ordering, and regression tests are internally consistent under static inspection. Supplied GitHub checks are complete and successful. Recommend APPROVE.
Deterministic publication result: 0 blocking and 0 non-blocking inline finding(s) publishable; 0 duplicate(s) suppressed; 0 blocking screenshot-evidence requirement(s) in this review body.
Pending checks: 1 check(s) are not complete.
This approval reflects the completed code review only; merge readiness remains governed by the repository's required checks.
Context
In OpenAI Realtime Expert-Spokesperson calls, the spokesperson can begin a spoken acknowledgement and invoke the handoff tool in the same response. Berd treated that handoff as a cancellation of the response that produced it, marking its own acknowledgement interrupted. OpenAI could then report that the already-finished response was no longer active and terminate the call.
Normal hangup could also stop the native runtime before already-queued provider events reached it, surfacing
Spokesperson runtime is unavailableduring teardown.Summary
A handoff starts Expert work without cancelling acknowledgement audio that has already begun. Once the acknowledgement finishes generating, the Expert response can start while its audio drains. Expert audio replaces any remaining acknowledgement without overlapping it. User speech still interrupts playback immediately.
The provider's late
Cancellation failed: no active response foundrace no longer ends the call.Hangup drains provider events that were already queued before stopping the native runtime, preventing a late teardown event from surfacing as a call failure.
Reviewer-reproducible example
just dev, configure Voice for OpenAI Realtime Expert-Spokesperson, start a voice call, and mute the microphone.pwdand report the printed path. The wording can vary; the request must require Expert tool use and produce a handoff.Spokesperson → Expert · Handoffevent appears without marking the acknowledgement Interrupted.pwdtool-use request, wait for the handoff event, then hang up. Confirm the call returns to its normal start state without either cancellation error orSpokesperson runtime is unavailable.